<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>修改学生信息</title>
    <script src="js/jquery-3.6.3.min.js"></script>
</head>
<body>
<%--<%
    long stuno = StrUtil.toLong(request.getParameter("stuno"), 0L);
    Student stu = StudentService.ME.get(stuno);
%>--%>
<form action="doUpdateStudent.jsp" method="post">
    <p><label>编号:</label>
        <input type="number" value="${stu.stuno}" id="id" name="stuno"/>
    </p>
    <p><label>姓名:</label>
    </p>
    <p><input type="text" id="sname" name="sname" value="${stu.sname}"/>
    </p>
    <p><label>入学时间:</label>
        <input type="date" id="hour" name="enterdate"
               value='<fmt:formatDate value="${stu.enterdate}" pattern="yyyy-MM-dd"/>'/>
    </p>
    <p>

        <label>年级号：</label>
        <select id="gradeid" name="gradeid">
            <c:forEach items="${grades}" var="g">
                <option value="${g.id}">${g.gname}</option>
            </c:forEach>
        </select>
    </p>
    <p>
        性别：<input type="radio" name="sex" value="男"/>男
        <input type="radio" name="sex" value="女"/>女
        <input type="radio" name="sex" value="妖"/>妖
    </p>

    <input type="submit" value="Update"/>
</form>
<script>
    $(function () {
        $("[name=sex][value=${stu.sex}]").prop("checked", true);
        $("[name=gradeid]").val('${stu.gradeid}');
    });
</script>
</body>
</html>
